<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<input type="button" value="分享朋友圈" onclick="shareFriend()" />

</body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript" ></script>
<script src="/js/jquery-3.2.1.min.js"></script>
<script>
    var timestamp = Date.parse(new Date());

    $(function(){
        $.post("/third/wechatSignature",{},function(result){
            alert(JSON.stringify(result));
            var signature=result.data["signature"];
            wx.config({
                debug: true,
                appId:"wx9cb3d2b8641fb744",
                timestamp:timestamp,
                nonceStr:"1234567890",
                signature:signature,
                jsApiList:["onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ"]
            });
            wx.ready(function(){


            });
            wx.error(function(res){
                alert(JSON.stringify(res));
            });
        });

    })
    function shareFriend(){
        alert("点击分享朋友");
        wx.onMenuShareAppMessage({
            title:"测试页面",
            desc:"完美",
            link:"http://182.254.244.64:11084",
            imgUrl:"http://182.254.244.64:11084/images/login/login-logo.png",
            success:function(){
                alert("分享成功");
            }}
        );
    }


</script>
</html>